#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;

const int N = 1e5 + 10;

int n;
int prime[N], cnt;
bool st[N];

void init(int n){
    for(int i = 2; i <= n; i ++){
        if(!st[i]) prime[cnt ++] = i;

        for(int j = 0; prime[j] <= n / i; j ++){
            st[prime[j] * i] = true;
            if(i % prime[j] == 0) break;
        }
    }
}

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);

    scanf("%d", &n);
    init(n + 1);

    if(n <= 2){
        printf("1\n");
    }else{
        printf("2\n");
    }

    for(int i = 1; i <= n; i ++){
        if(st[i + 1]) printf("1 ");
        else printf("2 ");
    }

    return 0;
}